# Maintainer: Jiachen YANG <farseerfc@gmail.com>
# Contributor: Allen Wild <allenwild93@gmail.com>
# Contributor: judd <jvinet@zeroflux.org>
# Contributor: dkaylor <dpkaylor@gmail.com>
# Contributor: Pablo Lezaeta <prflr88@gmail.com>

pkgname=xfsdump
pkgver=3.1.12
pkgrel=1
pkgdesc="Additional XFS filesystem utilities"
arch=(loong64 x86_64)
url="http://xfs.org"
license=('GPL')
depends=('xfsprogs' 'attr' 'acl' 'dmapi' 'util-linux-libs' 'gcc-libs' 'ncurses' 'glibc')
source=(https://kernel.org/pub/linux/utils/fs/xfs/xfsdump/xfsdump-${pkgver}.tar.{xz,sign})
# Eric R. Sandeen <sandeen@sandeen.net>
# Carlos Eduardo Maiolino <carlos@maiolino.me> <cem@kernel.org>
validpgpkeys=('2B8185919E8D248981869DED20AE1692E13DDEE0'
'4020459E58C1A52511F5399113F703E6C11CF6F0')
sha256sums=('f39c4c1b306b2dd7ec979c0e94d60fe69083d2ecf9af051cac5ef3bed772c74a'
            'SKIP')

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  ./configure --prefix=/usr --sbindir=/usr/bin INSTALL_USER=root INSTALL_GROUP=root
  make
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}" install

  # root /sbin directory can't be overridden properly with configure,
  # so move files manually
  mv -vf "${pkgdir}/sbin/"* "${pkgdir}/usr/bin/"
  rmdir "${pkgdir}/sbin"
}
